#include "global.h"

// Manages the process switching
void scheduler()
{
	if (running->status == READY)
	{
		// If running is still ready, put it back in ready queue
		enqueue(running, &readyQueue);
	}
	else if (running->status == DEAD)
	{
		// If running is dead, free it and put it in the free queue
		running->status = FREE;
		enqueue(running, &freeQueue);
	}
	// Return the next process in the ready queue
	running = dequeue(&readyQueue);
	running->time = PROCESS_RUNTIME;
}
